Repository navigation
fix(web): scheduled task editor shows and changes the task's permissions - #37513
juliusmarminge wants to merge 2 commits into
Conversation
A task created by an agent stores the creating thread's runtime mode, and every unbound run opens its new thread in that mode. The web editor had no control for it, so the stored mode could not be seen or changed there (the mobile editor already has one). Add a Permissions select, disabled for thread-bound tasks, which run in their thread's mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The editor now exposes existing permission modes for scheduled tasks not bound to a thread. Defaults and administrator restrictions remain unchanged, keeping the change limited to explicit user selection. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Bound runs use their thread's permissions, so a disabled control showing the task's stored mode reported a mode those runs never use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The automated pipeline stopped on this pull request and will not merge it: the reviewers still had findings after 3 rounds (the work is on main...factory/issue-32237):
It stays open for a person to finish or close. |
Scheduled tasks created by an agent store the creating thread's runtime mode (OrchestratorMcpService schedule_task stores limits.runtimeMode), and unbound runs launch new threads at that stored mode (ScheduledTaskService passes active.runtimeMode). The issue's two remedies are: (1) resolve the current default at launch, or (2) at minimum let the web editor show and change the stored mode. Option 1 would raise runs above the creator's mode, which PR #15219 deliberately caps; that is a maintainer decision, so it is left out (see outOfScope). This change does option 2. The web editor (apps/web/src/components/settings/ScheduledTasksSettings.tsx) had no runtime-mode control even though the mobile editor already has one, so the app contradicted itself and the stored mode could not be seen or changed from web. The fix adds a 'Permissions' Select below Model, built with the same runtimeModeConfig/runtimeModeOptions and managedRuntimeModeDenial pattern as Settings' 'Default permissions' control: same labels, icons and descriptions, with modes above the administrator's limit disabled and the reason shown. It is disabled for thread-bound tasks, as the Model picker is, because those runs use their thread's mode. The existing step that lowers a stored mode above the administrator's limit on save is kept so older tasks still save; only its outdated comment ('Tasks have no mode picker') was corrected. No server or contract change; no new regex or parser.
Fixes #32237
Reproduction on main
Commit 4bf5d53 (origin/main). Ran
T3CODE_DEV_SEED=0 vp run devin a fresh worktree (fresh database) and added a demo git project. Set the server settings defaultRuntimeMode to "auto". Through the server's own MCP endpoint (a short-lived client session, ast3 threaduses), launched a thread on claudeAgent/claude-haiku-5-5 without an explicit mode; it opened with runtimeMode "auto". Its prompt asked the agent to call schedule_task with prompt "Say hello", bindToCurrentThread false, interval 60 minutes. The agent created scheduled-task:598b4cfa…. Its scheduled_tasks row: thread_id NULL, thread_mode new_thread, runtime_mode auto, interaction_mode default, created_by agent, creation_source mcp. Then changed defaultRuntimeMode to "full-access". A control thread launched by hand afterwards opened in runtimeMode "full-access". Ran run_scheduled_task_now on the task: lastRunStatus succeeded, and its new thread "Say hello" opened in runtimeMode "auto", not full-access. Code: schedule_task storesruntimeMode: limits.runtimeMode(the calling thread's mode) at apps/server/src/mcp/OrchestratorMcpService.ts:2039, and unbound runs launch withruntimeMode: active.runtimeModeat apps/server/src/scheduledTasks/ScheduledTaskService.ts:1015. The web scheduled-task editor (apps/web/src/components/settings/ScheduledTasksSettings.tsx) has no runtime-mode control; it only clamps the stored value on save. The mobile editor has one in its model picker.Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp run check:changed: pass (format, lint, knip 1/2 and 2/2, typecheck of 2 packages, 1 adjacent test file with 7 tests, react compiler). Manual: T3CODE_DEV_SEED=0 vp run dev, paired the preview browser, opened Settings > Scheduled tasks > New task; the dialog shows 'Permissions: Full access' below Model. Not checked in the app: changing the mode, saving it, or the agent-created repro from the issue.
Not in this change
Who did the work
Run by the t3code factory in T3 Code.